package eos.dom.server;

import java.util.Stack;

import javax.jdo.annotations.Element;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Discard {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	@Element(dependent="true")
	private Stack<Integer> discardCards = new Stack<Integer>();

	public boolean isEmpty() {
		return discardCards.isEmpty();
	}

	public void setCards(Stack<Integer> cards) {
		this.discardCards = cards;
	}

	public Stack<Integer> getCards() {
		return discardCards;
	}

	public void push(Integer card) {
		discardCards.push(card);
	}

	public void clear() {
		discardCards.clear();
	}
	
}
